\section{双倒立摆}
\begin{figure}[!h]\begin{center}
    \includegraphics[scale=0.4]{twopendular.png}
    \caption{双倒立摆模型}\label{figtwopendular}
\end{center}\end{figure}
参考《Robust Adaptive Control》例2.2.1，但角度仍然以向左偏为正。类似建模方法得到
\[\ddot{x}\cos\theta_1-l_1\ddot{\theta_1}+g\sin\theta_1=0\]
\[\ddot{x}\cos\theta_2-l_2\ddot{\theta_2}+g\sin\theta_2=0\]
\[F=M\ddot{x}+m_1a_{1x}+m_2a_{2x}\]
按照书中的线性化方法得到
\begin{align*}
    &M\dot{v}=m_{1}g\theta_{1}+m_{2}g\theta_{2}+u \\
    &\dot{v}-l_{1}\ddot{\theta}_{1}+g\theta_{1}=0 \\
    &\dot{v}-l_{2}\ddot{\theta}_{2}+g\theta_{2}=0
\end{align*}
取$m_1=m_2=1$kg，$M=10m_1$，$l_1=1$m，$l_2=2$m，$g=10$kg$\cdot$m/s$^2$，得到
\begin{align*}
    &\ddot{\theta_1}=11\theta_1+\theta_2+0.1u \\
    &\ddot{\theta_2}=0.5\theta_1+5.5\theta_2+0.05u \\
    &\dot{v}=\theta_1+\theta_2+0.1u
\end{align*}
写成状态空间形式
\[
    \begin{bmatrix}
        \dot{\theta_1} \\ \ddot{\theta_1} \\ \dot{\theta_2} \\ \ddot{\theta_2} \\ v'
    \end{bmatrix}
    =\begin{bmatrix}
        0 & 1 & 0 & 0 & 0 \\
        11 & 0 & 1 & 0 & 0 \\
        0 & 0 & 0 & 1 & 0 \\
        0.5 & 0 & 5.5 & 0 & 0 \\
        1 & 0 & 1 & 0 & 0 \\
    \end{bmatrix}
    \begin{bmatrix}
        \theta_1 \\ \dot{\theta_1} \\ \theta_2 \\ \dot{\theta_2} \\ v
    \end{bmatrix}
    +
    \begin{bmatrix}
        0 \\ 0.1 \\ 0 \\ 0.05 \\ 0.1
    \end{bmatrix}u
\]
